<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台登录</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/xadmin.css">
    <script type="text/javascript" src="../js/jquery-3.2.1.js"></script>
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
</head>
<body>
    <div class="x-body">
       <table class="layui-hide" id="test" lay-filter="test"></table>
    </div>
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="accept">接受</a>
            <a class="layui-btn layui-btn-xs" lay-event="edit">安排</a>
        </script>
    
    <script type="text/javascript">
            layui.use(['table', 'layer'], function() {
                    var layer = layui.layer;
                    var table = layui.table;
                    
                    var data = {enable:1};
            if(window.location.href.indexOf("?")!=-1){
                 var para =  window.location.href.substr(window.location.href.indexOf("?")+1);
                 if(para != null && para != undefined && para.trim() != ''){
                     para = para.replace(/=/g,':');
                     para = para.replace(/&/g,',');
                     data = $.extend({},data,eval('({'+para+'})'));
                     console.log(data);
                     console.log(para);
                 }
            }
        
                    table.render({
                        elem: '#test'
                        ,id: 'fixTable'
                        ,height: 605
                        ,url: 'findComplaint' //数据接口
                        ,where:data
                        ,page: {limits:[10, 20, 30]} //开启分页
                        ,toolbar: true  //开启工具栏
                        ,request: {
                            pageName: 'pageNo' //页码的参数名称，默认：page
                            ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
                        }
                        ,cols: [[ //表头
                         
                          {field: 'complaintId', title: 'ID', width:80, sort: true, fixed: 'left'}
                          ,{field: 'userId', title: '用户ID', width:80, sort: true, fixed: 'left'}
                          ,{field: 'presonName', title: '用户', width:100,  fixed: 'left'}
                          ,{field: 'complaintObject', title: '投訴', width:150}
                          ,{field: 'complaintContent', title: '问题描述', width: 250}
                    //      ,{field: 'isRead', title: '申请时间', width:120, sort: true}
                    //      ,{fixed: 'right', title: '操作', width: 120,templet:'#barDemo'}
                        ]]
                     
                   });
                     //监听行工具事件
              /*     table.on('tool(test)', function(obj){
                    var data = obj.data;
                    if(obj.event === 'accept'){
                       
                    } else if(obj.event === 'edit'){
                        x_admin_show('编辑','./fix-update.html?fixBillId='+data.fixBillId);
                    }
                  }); */
            });
            
        </script>

  </body>
</html>